package #(basePackage).#(table.moduleType).#(table.moduleName).#(table.domainName).controller.#(sceneEnum.basePackage).vo.#(table.businessName);

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;
import org.noear.solon.validation.annotation.NotEmpty;
import org.noear.solon.validation.annotation.NotNull;
import java.util.*;
### 处理 BigDecimal 字段的引入
#for(column : columns)
#if(column.javaType == "BigDecimal")
import java.math.BigDecimal;
#break
#end
#end

### 处理 LocalDateTime 字段的引入
#for(column : columns)
#if((column.createOperation || column.updateOperation) && column.javaType == "LocalDateTime")
import java.time.LocalDateTime;
#break
#end
#end

### 特殊：主子表专属逻辑
#for(subTable : subTables)
import #(basePackage).#(table.moduleType).#(table.moduleName).#(table.domainName).entity.#(subTable.className);
#end

/**
 * @author "#(table.author)"
 */
@ApiModel(value = "#(sceneEnum.name) - #(table.classComment)新增/修改 Request VO")
@Data
public class #(sceneEnum.prefixClass)#(table.className)ReqVo {

### 逐个处理字段
#for(column : columns)
#if(column.createOperation || column.updateOperation)
### 1. 处理 Swagger 注解
    @ApiModelProperty(value = "#(column.columnComment)"#if(!column.nullable), required = true#end#if(column.example != ""), example = "#(column.example)"#end)
### 2. 处理 Validator 参数校验
#if(!column.nullable && !column.primaryKey)
#if(column.javaType == 'String')
    @NotEmpty(message = "#(column.columnComment)不能为空")
#else
    @NotNull(message = "#(column.columnComment)不能为空")
#end
#end
### 3. 处理字段定义
    private #(column.javaType) #(column.javaField);

#end
#end

### 特殊：主子表专属逻辑（非 ERP 模式）
#if(subTables && subTables.size() > 0 && table.templateType != 11)
#for(subTable : subTables)
#set(index = for.index)
    #if(subTable.subJoinMany)
    @ApiModelProperty(value = "#(subTable.classComment)列表")
    private List<#(subTable.className)> #(subClassNameVars.get(index))s;

    #else
    @ApiModelProperty(value = "#(subTable.classComment)")
    private #(subTable.className) #(subClassNameVars.get(index));

    #end
#end
#end
}